#ifndef TCPCLIENT_H
#define TCPCLIENT_H

#include <QObject>
#include <QTcpSocket>
#include <QMap>

///
/// \brief The TcpClient class
///网络连接，并发送数据
class TcpClient : public QObject
{
    Q_OBJECT
public:
    explicit TcpClient(QObject *parent = nullptr);

    QTcpSocket* mp_clientSocket;

    bool isconnent=false;

    QString ip="127.0.0.1";

    int port=6606;

    QMap<int, QString> tempDatas; //  掉线没有发出的数据，
    int sendid=0;

signals:
     void RecvMessage(QString * data);
     void ConnentState(bool state);
public slots:
    void  linkServer();

    void  relink();

    void sendMessage(const QString &msg,int overid=0);

    void ClientRecvData();


};

#endif // TCPCLIENT_H
